package com.njlime.member.service.sys;

import com.njlime.core.helper.PageBean;
import com.njlime.member.entiies.TMember;
import com.njlime.member.entiies.TMemberGroup;
import com.njlime.member.repository.sms.MemberDao;
import com.njlime.member.repository.sms.MemberGroupDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
@Service
@Transactional(readOnly = true)
public class MemberGroupService {

    @Resource
    private MemberGroupDao memberGroupDao;


    public List<TMemberGroup> list(TMemberGroup info  ) {
        return memberGroupDao.list(  info );
    }


    @Transactional(readOnly = false)
    public void add(TMemberGroup info) {
        memberGroupDao.save(info);
    }

    public Map getSumMember(TMemberGroup info) {
        return memberGroupDao.getSumMember(info);
    }

    @Transactional(readOnly = false)
    public void edit(TMemberGroup info) {
        memberGroupDao.edit(info);
    }

    public TMemberGroup findOne(Integer memberGroupId) {
        return memberGroupDao.findOne(memberGroupId);
    }


    @Transactional(readOnly = false)
    public void deleteGroup(String id, int unitId) {
        memberGroupDao.deleteGroup(id,unitId);
    }
}
